package com.vdf.sisconsolid.persistencemodule.dao;

import com.vdf.sisconsolid.persistencemodule.converter.TracingConverter;
import com.vdf.sisconsolid.persistencemodule.dto.TracingDTO;
import com.vdf.sisconsolid.persistencemodule.model.Tracing;

public class TracingDao extends BaseDao {

	public TracingDTO find(Long idTracing) {
		this.initTransaction();
		TracingDTO tracing = TracingConverter.toDTO((Tracing) super.getEm()
				.find(Tracing.class, idTracing));
		this.commitTransaction();
		return tracing;
	}

	public void merge(TracingDTO tDTO) {
		try {
			Tracing tracing = TracingConverter.toEntity(tDTO);
			super.merge(tracing);
		} catch (Throwable e) {
			e.printStackTrace();
			rollbackTransaction();
		}
	}
	
	public void remove(Long idTracing) {
		super.remove(Tracing.class, idTracing);
	}

	public void updateNeed(Tracing tracing) {

	}

}
